#ifndef _QQDEF_H
#define _QQDEF_H

typedef unsigned int uint;
typedef unsigned short ushort;
typedef unsigned char uchar;

#define UDP 0
#define TCP 1
#define PROXY_HTTP 2

#define MIN(a,b)(a>b?b:a )
#define KB(a) a*1024
#define MB(a) a*KB(1024)
#define CN_TIME(a) a
//#define CN_TIME(a) (a+15*3600) //from New York Time to Beijing Time

//Preference  more in protocol.c: process_packet
/*
#define NO_BUDDY_INFO	//don't get buddy list or online list
#define NO_BUDDY_DETAIL_INFO //don't get buddy mail account, alias, signiture info
#define NO_QUN_INFO //don't get qun info
#define NO_GROUP_INFO //don't get group info
#define NO_IM //don't get instant messages
#define NO_KEEPALIVE
*/

#define MAX_LOOP_PACKET 32
#define MAX_COMMAND 0x0200
#define MAX_BUDDY 1200	//最大好友个数
#define MAX_QUN	128	//最多群个数
#define MAX_QUN_MEMBER 800	//群最多800成员
#define MAX_GROUP 128	//最多分组个数
#define MAX_EVENT 128	//最多事件缓冲个数
#define USER_INFO_LEN 256
#define MAX_USER_INFO 38
#define SIGNITURE_LEN 256	//100
#define TOKEN_LEN 256		//256
#define ACCOUNT_LEN 64		//
#define NICKNAME_LEN 64		//12
#define GROUPNAME_LEN 256
#define AUTO_REPLY_LEN 256
#define ALIAS_LEN 32		//8
#define PATH_LEN 1024

#define MAX_SERVER_ADDR 16

enum QQSTATUS{
	QQ_NONE = 0x00,
	QQ_ONLINE = 0x0a,
	QQ_OFFLINE = 0x14,
	QQ_AWAY = 0x1e,
	QQ_BUSY = 0x32,
	QQ_KILLME = 0x3C,
	QQ_QUIET = 0x46,
	QQ_HIDDEN = 0x28
};

enum MESSAGE_TYPE{
	MT_BUDDY,
	MT_QUN,
	MT_SYSTEM,
	MT_NEWS,
	MT_QUN_MEMBER
};

typedef struct _DUMMY_pthread_t
{
	char dummy[8];
} _DUMMY_pthread_t;

typedef struct _DUMMY_qqpacketmgr
{
	char dummy[144];
} _DUMMY_qqpacketmgr;

typedef struct _DUMMY_list
{
	char dummy[16];
} _DUMMY_list;

typedef struct _DUMMY_loop
{
	char dummy[32];
} _DUMMY_loop;

typedef struct _DUMMY_pthread_mutex_t
{
	char dummy[4];
} _DUMMY_pthread_mutex_t;

#endif
